package com.orphan.audit.dao;

import com.orphan.audit.po.Discount;
import com.orphan.audit.po.SupplierReturnCommodity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.mapping.FetchType;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author yichen
 * @since 2021-07-14
 */
@Mapper
public interface SupplierReturnCommodityMapper extends BaseMapper<SupplierReturnCommodity> {
    @Select("select * from t_supplierreturn_commodity")

    @Results(id = "supplierCommodityMap",value = {
            @Result(column = "t_id",property = "tId",id = true),
            @Result(column = "fk_id",property = "fkId"),
            @Result(column = "goods_id",property = "goodsId"),
            @Result(column = "goods_name",property = "goodsName"),
            @Result(column = "goods_num",property = "goodsNum"),
            @Result(column = "type",property = "type"),
            @Result(column = "size",property = "size"),
            @Result(column = "price",property = "price"),
            @Result(column = "fk_id",property = "supplierReturnAudit",
                    one = @One(select = "com.orphan.audit.dao.SupplierReturnAuditMapper.getById",
                            fetchType = FetchType.LAZY))
    })
    List<SupplierReturnCommodity> getAll();
}
